<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui.form小例子</title>
    <link rel="stylesheet" href="../layui/dist/css/layui.css" media="all">
</head>

<body>

<div id="test"></div>

<script src="../layui/dist/layui.js"></script>
<script>
    layui.use('util', function(){
        var util = layui.util;

        var endTime = new Date(2099,1,1).getTime()
            ,serverTime = new Date().getTime();

        var a = new Date(2099,1,1);
        console.log(a);
        console.log(endTime);

        util.countdown(endTime,serverTime,function(date,serverTime,timer){
            var str = date[0]+'天'+date[1]+'时'+date[2]+'分'+date[3]+'秒';
            layui.$("#test").html('还有:'+str);
        })

    });

</script>
</body>
</html>